home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / tools / prtfolio / wksplot.bas < prev    next >
Encoding:
BASIC Source File  |  1994-09-22  |  1.1 KB  |  56 lines

  1. ' WKSPLOT by BJ Gleason
  2. ' Plot a column of number from
  3. ' a spreadsheet
  4. dim y(80)
  5. oldscr=screen
  6. Input "SpreadSheet File [WKSPLOT]";wks$
  7. if wks$="" then wks$="wksplot"
  8. print "Range can only be one-dimensional"
  9. print "Columns A-Z, Rows must be 2 digits"
  10. Input "Range i.e., A01.A80 ";rc$ : rc$=ucase$(rc$)
  11. cs=asc(mid$(rc$,1,1))-65
  12. ce=asc(mid$(rc$,5,1))-65
  13. rs=val(mid$(rc$,2,2))-1
  14. re=val(mid$(rc$,6,2))-1
  15. if cs=ce then
  16.   rc=true
  17.   j=cs
  18.   n=re-rs
  19. else
  20.   rc=false
  21.   j=rs
  22.   n=ce-cs
  23. endif
  24. Input "Bar or XY ";type$
  25. for i=0 to n
  26. if rc then
  27.   y(i)=wksread(wks$,i+rs,j)
  28. else
  29.   y(i)=wksread(wks$,j,i+rs)
  30. endif
  31.   if i=0 then high=y(i) : low=y(i)
  32.   if y(i) > high then high=y(i)
  33.   if y(i) < low then low=y(i)
  34.   print y(i),
  35. next i
  36.  
  37. screen 6
  38. p=240/(n+1)
  39. w=p-2
  40. h=62/high
  41. if type$ = "B" or type$ = "b" then
  42.   for i=0 to n step 2
  43.     line(i*p,63)-(i*p+w,63-y(i)*h),1,BF
  44.   next i
  45.   for i=1 to n step 2
  46.     line(i*p,63)-(i*p+w,63-y(i)*h),1,B
  47.   next i
  48. else
  49.   for i=1 to n
  50.     line((i-1)*p,63-y(i-1)*h)-(i*p,63-y(i)*h),1
  51.   next i
  52. endif
  53. wait
  54. screen oldscr
  55. if isrun then run "menu" else end
  56. ə